<?php

namespace App\Http\Requests\Admin\ActivityComRedPacket;

use App\Http\Requests\Request;

class UpdateRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'vip_post_number'=>'integer',
            'vip_resume_number'=>'integer',
            'vip_integral'=>'integer',
            'resume_number'=>'integer',
            'integral'=>'integer',
            'vip_post_number'=>'integer',
            'frequency'=>'required|integer|min:1',
            'time_interval'=>'integer',
            'end_at'=>'required|date',
            'description'=>'required'
        ];
    }
    public function messages()
    {
        return [
            'vip_post_number.integer'=>'赠送会员职位数必须是数字',
            'vip_resume_number.integer'=>'赠送会员简历数必须是数字',
            'vip_integral.integer'=>'赠送会员积分必须是数字',
            'resume_number.integer'=>'赠送简历数必须是数字',
            'integral.integer'=>'赠送积分必须是数字',
            'frequency.required'=>'最大分享次数必须填写',
            'frequency.integer'=>'最大分享次数必须是数字',
            'frequency.min'=>'最大分享次数必须大于等于1',
            'time_interval.integer'=>'分享时间间隔必须是数字',
            'end_at.required'=>'结束时间必须填写',
            'end_at.date'=>'结束时间必须为YYYY-mm-dd时间格式',
            'description.required'=>'红包描述必须填写'
        ];
    }
}
